<%--
  User: MadFrog
  Date: 2016/11/5
  Time: 17:19
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<html>
<head>
    <title>绑定教工</title>
    <%@include file="../common/_head.jsp" %>
</head>
<body ontouchstart>
<div class="weui-cells weui-cells_form">
    <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">教工号</label></div>
        <div class="weui-cell__bd">
            <input class="weui-input" type="number" id="jgh" pattern="[0-9]*" placeholder="请输入教工号">
        </div>
    </div>
    <div class="weui-cell">
        <div class="weui-cell__hd"><label class="weui-label">身份证号</label></div>
        <div class="weui-cell__bd">
            <input class="weui-input" id="sfzh" placeholder="请输入身份证号">
        </div>
    </div>
</div>
<div class="weui-cells weui-cells_form">
    <a href="javascript:;" class="weui-btn weui-btn_primary" id="submitButton">确定</a>
</div>

<br>
<br>
<div class="weui-msg__text-area">
    <p class="weui-msg__desc">
        只能绑定一次，请勿恶意绑定！
    </p>
</div>

<%@include file="../common/_foot.jsp" %>

<script>
    $("#submitButton").click(function () {
        var jgh = $('#jgh').val();
        var sfzh = $('#sfzh').val();
        var params = {};
        params.jgh = jgh;
        params.sfzh = sfzh;
        if($.trim(jgh)==null || $.trim(jgh)==''){
            $.toptip('不能为空！')
            return;
        }
        $.ajax({
            type: "post",
            url: "bind",
            data: params,
            dataType: "json",
            success: function (wechatReturn) {
                $.toast(wechatReturn.msg, function () {
                    window.location.href = "index";
                });
            },
            error: function (wechatReturn) {
                $.toast(wechatReturn.msg, "cancel");
            }
        });
    });
</script>
<div class="weui-footer weui-footer_fixed-bottom">
    <p class="weui-footer__text">
        Copyright © 2016-2018 应用技术系<br>
        四川幼儿师范高等专科学校
    </p>
</div>
</body>
</html>
